import instance from "../../utils/request";
import { baseURL } from "../../config";
import axios from "axios";





//登录方法
export const _login = async (params) => {
  
  try{
    const res = await instance.post(baseURL + "admins/login",params,{
      headers: {
        'Content-Type': 'application/json'
      }
    })
      // console.log(res);
      return res
      }
  catch(err){
      console.log(err)
      return err
  };
};



//注册方法
export const _register = async (params) => {
  try {
    const res =  await axios.post(baseURL + 'admins/register',params,{
      headers:{
        'Content-Type':'application/json'
      }
    })
    console.log(res);
    
  } catch (err) {
    console.log(err);
    
  }
};


